\(\int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx\) [18]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 14 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log (\cos (a+b x))}{2 b} \]

[Out]

-1/2*ln(cos(b*x+a))/b

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {4373, 3556} \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log (\cos (a+b x))}{2 b} \]

[In]

Int[Csc[2*a + 2*b*x]*Sin[a + b*x]^2,x]

[Out]

-1/2*Log[Cos[a + b*x]]/b

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int \tan (a+b x) \, dx \\ & = -\frac {\log (\cos (a+b x))}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log (\cos (a+b x))}{2 b} \]

[In]

Integrate[Csc[2*a + 2*b*x]*Sin[a + b*x]^2,x]

[Out]

-1/2*Log[Cos[a + b*x]]/b

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93

method result size
default \(-\frac {\ln \left (\cos \left (x b +a \right )\right )}{2 b}\) \(13\)
risch \(\frac {i x}{2}+\frac {i a}{b}-\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{2 b}\) \(30\)

[In]

int(csc(2*b*x+2*a)*sin(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

-1/2*ln(cos(b*x+a))/b

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log \left (-\cos \left (b x + a\right )\right )}{2 \, b} \]

[In]

integrate(csc(2*b*x+2*a)*sin(b*x+a)^2,x, algorithm="fricas")

[Out]

-1/2*log(-cos(b*x + a))/b

Sympy [F(-1)]

Timed out. \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=\text {Timed out} \]

[In]

integrate(csc(2*b*x+2*a)*sin(b*x+a)**2,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (12) = 24\).

Time = 0.22 (sec) , antiderivative size = 55, normalized size of antiderivative = 3.93 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, a\right ) + \sin \left (2 \, a\right )^{2}\right )}{4 \, b} \]

[In]

integrate(csc(2*b*x+2*a)*sin(b*x+a)^2,x, algorithm="maxima")

[Out]

-1/4*log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*a) + cos(2*a)^2 + sin(2*b*x)^2 - 2*sin(2*b*x)*sin(2*a) + sin(2*a)^2
)/b

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.29 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\log \left (-\sin \left (b x + a\right )^{2} + 1\right )}{4 \, b} \]

[In]

integrate(csc(2*b*x+2*a)*sin(b*x+a)^2,x, algorithm="giac")

[Out]

-1/4*log(-sin(b*x + a)^2 + 1)/b

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \csc (2 a+2 b x) \sin ^2(a+b x) \, dx=-\frac {\ln \left (\cos \left (a+b\,x\right )\right )}{2\,b} \]

[In]

int(sin(a + b*x)^2/sin(2*a + 2*b*x),x)

[Out]

-log(cos(a + b*x))/(2*b)